﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Xml.Linq;
using System.Collections.ObjectModel;
using LUStationery.DAO;

namespace LUStationery.Model
{
   public class Order
    {
        private int _orderID;

        public int OrderID
        {
            get { return _orderID; }
            set { _orderID = value; }
        }
  
       private int _purchaseOrderID;

        public int PurchaseOrderID
        {
            get { return _purchaseOrderID; }
            set { _purchaseOrderID = value; }
        }
        private int _supplierItemID;

        public int SupplierItemID
        {
            get { return _supplierItemID; }
            set { _supplierItemID = value; }
        }
        private string _itemCode;

        public string ItemCode
        {
            get { return _itemCode; }
            set { _itemCode = value; }
        }
        private string _itemDesc;

        public string ItemDesc
        {
            get { return _itemDesc; }
            set { _itemDesc = value; }
        }
        private string _supplierCode;

        public string SupplierCode
        {
            get { return _supplierCode; }
            set { _supplierCode = value; }
        }
        private string _supplierName;

        public string SupplierName
        {
            get { return _supplierName; }
            set { _supplierName = value; }
        }
        private int _orderQty;

        public int OrderQty
        {
            get { return _orderQty; }
            set { _orderQty = value; }
        }
        private int _actualQty;

        public int ActualQty
        {
            get { return _actualQty; }
            set { _actualQty = value; }
        }
        private double _price;

        public double Price
        {
            get { return _price; }
            set { _price = value; }
        }
        private double _orderPrice;

        public double OrderPrice
        {
            get { return _orderPrice; }
            set { _orderPrice = value; }
        }
        private DateTime _orderDate;

        public DateTime OrderDate
        {
            get { return _orderDate; }
            set { _orderDate = value; }
        }
        private string status;

        public string Status
        {
            get { return status; }
            set { status = value; }
        }


        public Order(Item i,Supplier s,SupplierItem si,int orderQty)
        {
            SupplierItemID = si.SupplierItemID;
            ItemCode = i.ItemNumber;
            ItemDesc = i.ItemDesc;
            SupplierCode = s.SupplierCode;
            SupplierName = s.SupplierName;
            OrderQty = orderQty;
            Price = si.Price;
            OrderPrice = Price * OrderQty;
            Status = "pending";
            OrderDate = System.DateTime.Now;

        }
        public Order()
        {
        
        }
       





    }
   public class OrderList : Collection<Order> { }
}
